﻿#include "qexcelsheet.h"

QExcelSheet::QExcelSheet(QAxObject *worksheet,QObject *parent) : QObject(parent)
{
    m_excelWorksheet = worksheet;
}

QString QExcelSheet::name()
{
    if(isAvailable()){
        return m_excelWorksheet->dynamicCall("Name").toString();
    }else{
        return "";
    }
}

int QExcelSheet::index()
{
    if(isAvailable()){
        return m_excelWorksheet->dynamicCall("index").toInt();
    }else{
        return -1;
    }
}

bool QExcelSheet::isAvailable()
{
    if(m_excelWorksheet && !m_excelWorksheet->isNull()){
        return true;
    }else{
        return false;
    }
}
